package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.entity.Issue;
import com.cskaoyan.bean.vo.BasePageData;
import com.cskaoyan.bean.vo.BaseParam;
import com.cskaoyan.bean.vo.BaseRespVo;
import com.cskaoyan.service.IssueService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *  小程序 帮助中心
 *
 */
@RestController
@RequestMapping("wx/issue")
public class WxIssueController {

    @Autowired
    IssueService issueService;

    @RequestMapping("list")
    public BaseRespVo issueList(BaseParam baseParam){
        // 判断是否退出登录
//        Subject subject = SecurityUtils.getSubject();
//        if(subject == null){
//            return BaseRespVo.fail("请登录后重试");
//
//        }
        BasePageData<Issue> issueList = issueService.getAllIssueList(baseParam);
        return BaseRespVo.ok(issueList);
    }
}
